<h2>DESCRIPTION</h2>

<em>g.mapset</em> changes the current working MAPSET, LOCATION, or GISDBASE.
This is a fairly radical maneuver to run mid-session, take care when running
the GUI at the same time.
<p>
With <em>g.mapset</em>, the shell history (i.e. <tt>.bash_history</tt> file
of the initial location will be used to record the command history.

<h2>NOTES</h2>

By default, the shell continues to use the history for the old mapset.
To change this behaviour the history can be switched to record in the new
mapset's history file as follows:

<div class="code"><pre>
# bash example
history -w
history -r /"$GISDBASE/$LOCATION/$MAPSET"/.bash_history
HISTFILE=/"$GISDBASE/$LOCATION/$MAPSET"/.bash_history
</pre></div>

<h2>EXAMPLES</h2>

<h3>Print the name of the current mapset</h3>

To print the name of the current mapset, use the <b>-p</b> command as
shown below:
<div class="code"><pre>
g.mapset -p
</pre></div>


<h3>List available mapsets</h3>
To list available mapsets, use the <b>-l</b> command as shown below:
<div class="code"><pre>
g.mapset -l
</pre></div>

This should list all the mapsets, such as: "landsat new PERMANENT user1."

<h3>Change the current mapset</h3>
To change the current mapset to "user1" use the following command:

<div class="code"><pre>
g.mapset mapset=user1 location=nc_spm_08_grass7
</pre></div>

You should receive the following message: "Mapset switched. Your shell
continues to use the history for the old mapset." 

<h3>Create a new mapset</h3>

To create a new mapset, use the <b>-c</b> tag as shown below:
<div class="code"><pre>
g.mapset -c mapset=new location=nc_spm_08_grass7
</pre></div>

<h2>SEE ALSO</h2>

<em>
<a href="g.gisenv.html">g.gisenv</a>,
<a href="g.mapsets.html">g.mapsets</a>
</em>

<h2>AUTHOR</h2>

Radim Blazek

<!--
<p>
<i>Last changed: $Date$</i>
-->
